﻿Public Class Custom_ReceiveGrid
    Dim _ColumnDataset_Dataset As New DataSet
    Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
    End Sub
    Property ColumnDataset_Dataset() As DataSet
        Get
            Return _ColumnDataset_Dataset
        End Get
        Set(ByVal value As DataSet)
            _ColumnDataset_Dataset = value
        End Set
    End Property
    Function Refresh_ColumnDataset(ByVal ColDataSet As DataSet)
        ColumnDataset_Dataset = ColDataSet
        With CboItem
            .DataSource = ColumnDataset_Dataset.Tables("item")
            .DisplayMember = "itemname"
            .ValueMember = "alternatenumber"
        End With
        With CboUnit
            .DataSource = ColumnDataset_Dataset.Tables("itemunitofmeasure")
            .DisplayMember = "unitofmeasure"
            .ValueMember = "unitofmeasureid"
        End With
    End Function

    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

    End Sub

    Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
        With DataGridView1
            If .Rows(e.RowIndex).Cells(1).Value = Nothing Then
                .Rows(e.RowIndex).Cells(1).Value = 1

            End If
        End With
    End Sub
End Class